Eslint 规则忽略 发表于 2020-05-28 | 更新于: 2022-05-04 | 分类于 sum , jsplus | 阅读次数: 字数统计: 198 | 阅读时长 ≈ 1 2020.5.28 星期四 :15:11 12345678910111213141516171819202122232425262728293031// 1. 在整个文件中取消eslint检查:/* eslint-disable */alert(‘foo’);// 2. 在整个文件中禁用某一项eslint规则的检查:/* eslint-disable no-alert */alert(‘foo’);// 3. 在整个文件中禁用多项eslint规则的检查:/* eslint-disable no-alert, no-console */alert(‘foo’);console.log(‘bar’);// 4. 针对某一行禁用eslint检查:alert(‘foo’); // eslint-disable-line// eslint-disable-next-linealert(‘foo’);// 5. 针对某一行的某一具体规则禁用eslint检查:alert(‘foo’); // eslint-disable-line no-alert// eslint-disable-next-line no-alertalert(‘foo’);// 6. 针对某一行禁用多项具体规则的检查:alert(‘foo’); // eslint-disable-line no-alert, quotes, semi// eslint-disable-next-line no-alert, quotes, semialert(‘foo’); knowledge is no pay,reward is kindness 打赏 微信支付 支付宝